<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app"> 
        <h1>爱好</h1>  
        <!-- for-in遍历  -->
        <ul>
            <li v-for="(item,key,index) in like"> 
                {{item}}---{{key}}---{{index}} 
            </li> 
        </ul> 
        <!-- for-of遍历  -->
        <ul>
            <li v-for="(item,key,index) of like"> 
                {{item}}---{{key}}---{{index}} 
            </li> 
        </ul> 
    </div> 
 
<script> 
    const vm = new Vue({ 
        el: "#app",
        data: {
            like: [ 
            { 
                name: '打游戏', 
                butt: '<button>选择</button>' 
            },
            { 
                name: '编程', 
                butt: '<button>选择</button>' 
            },
            { 
                name: '看电视',
                butt: '<button>选择</button>' 
            },
            ] 
        } 
    }); 
</script>
</body>
</html>